/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.unioeste.cc.vm;

import java.util.ArrayList;

/**
 *
 * @author diego
 */
public class Registers {

    int readReg1, readReg2;
    int readData1, readData2;
    int writeReg, writeData;
    int result;
    ArrayList<Integer> contents;

    public ArrayList<Integer> getContents() {
        return contents;
    }

    public void setContents(ArrayList<Integer> list) {
        this.contents = list;
    }

    public int getResult() {
        return result;
    }

    public void setResult(int result) {
        this.result = result;
    }

    public int getWriteReg() {
        return writeReg;
    }

    public void setWriteReg(int WriteReg) {
        this.writeReg = WriteReg;
    }

    public int getReadData1() {
        return readData1;
    }

    public void setReadData1(int readData1) {
        this.readData1 = readData1;
    }

    public int getReadData2() {
        return readData2;
    }

    public void setReadData2(int readData2) {
        this.readData2 = readData2;
    }

    public int getReadReg1() {
        return readReg1;
    }

    public void setReadReg1(int readReg1) {
        this.readReg1 = readReg1;
    }

    public int getReadReg2() {
        return readReg2;
    }

    public void setReadReg2(int readReg2) {
        this.readReg2 = readReg2;
    }

    public int getWriteData() {
        return writeData;
    }

    public void setWriteData(int writeData) {
        this.writeData = writeData;
    }

    public void createContents() {
        contents = new ArrayList<Integer>();

        for (int i = 0; i < 32; i++) {
            contents.add(i);
            //System.out.println("R[" + i + "]= " + i);
        }
    }

    /**
     * sinal de controle que permite a escrita no writeData
     */
    public void write() {
        if (writeReg == 1) {
            writeData = result;
        }
    }
}
